package com.crm.customers.dao.impl;

import org.springframework.stereotype.Repository;

import com.crm.base.dao.BaseDao;
import com.crm.customers.dao.CommissionDao;
import com.crm.customers.model.Commission;

@Repository("commissionDao")
public class CommissionDaoImpl extends BaseDao implements CommissionDao {

	private  static final String MAPPER_NAMESAPCE = "CommissionMapper.";
	
	@Override
	public Commission saveCommission(Commission c) {
		insert(MAPPER_NAMESAPCE+"saveCommission", c);
		return c;
	}

	@Override
	public Commission getcommissionInfoById(Commission c) {
		return selectOne(MAPPER_NAMESAPCE+"getCommissionInfo", c);
	}

	@Override
	public int updateCommissionApprovestate(Commission c) {
		return update(MAPPER_NAMESAPCE+"updateCommissionApprovestate", c);
	}

	@Override
	public int updateCommission(Commission c) {
		return update(MAPPER_NAMESAPCE+"updateCommission", c);
	}

	@Override
	public String getOverruleReason(Commission c) {
		return selectOne(MAPPER_NAMESAPCE+"getOverruleReason", c);
	}

	@Override
	public Integer getCommMoneyByCreatedate(Commission c) {
		return selectOne(MAPPER_NAMESAPCE+"getCommMoneyByCreatedate", c);
	}

}
